import request from '@/utils/request'

// 获取客户数据
export function getuserInfo(params) {
  return request({
    url: '/clients',
    params
  })
}

// 获取经纪
export function getAgents() {
  return request({
    url: '/agents'
  })
}

// 获取指定经纪的id
export function getAgentsId(id) {
  return request({
    url: `/agents/${id}`
  })
}

// 新增客户
export function addClients(data) {
  return request({
    url: '/clients',
    method: 'post',
    data
  })
}

// 删除客户
export function delClients(id) {
  return request({
    url: `/clients/${id}`,
    method: 'delete'
  })
}

// 编辑客户
export function updataClients(data) {
  return request({
    url: `/clients/${data.id}`,
    method: 'put',
    data
  })
}

// 获取指定分类
export function getUpClients(id) {
  return request({
    url: `/clients/${id}`
  })
}

// 获取分类数量
export function clientsCount(params) {
  return request({
    url: '/clients/count',
    params
  })
}
